<?php
/*
 * MiniMe - a minimalistic OStatus complient microblogging tool
 * Copyright (C) 2010, Tuomas Koski - koski.tuomas@gmail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * This object represents a xml similar to this:
 * <activity:subject>
 *  <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
 *  <id>http://identi.ca/user/209172</id>
 *  <title>Tester Koski</title>
 *  <link rel="alternate" type="text/html" href="http://identi.ca/testkoski"/>
 *  <link rel="avatar" type="image/jpeg" media:width="256" media:height="256" href="http://avatar.identi.ca/209172-256-20100804205939.jpeg"/>
 *  <link rel="avatar" type="image/jpeg" media:width="96" media:height="96" href="http://avatar.identi.ca/209172-96-20100804205939.jpeg"/>
 *  <link rel="avatar" type="image/jpeg" media:width="48" media:height="48" href="http://avatar.identi.ca/209172-48-20100804205939.jpeg"/>
 *  <link rel="avatar" type="image/jpeg" media:width="24" media:height="24" href="http://avatar.identi.ca/209172-24-20100804205939.jpeg"/>
 *  <poco:preferredUsername>testkoski</poco:preferredUsername>
 *  <poco:displayName>Tester Koski</poco:displayName>
 * </activity:subject>
 * 
 * 
 * @author     Tuomas Koski <koski.tuomas@gmail.com>
 * @copyright  Tuomas Koski
 * @license    http://www.gnu.org/licenses/lgpl.txt
 */
class Mm_Atom_Element_ActivityStream_Subject extends Mm_Xml_Element_Parent {
    
    const ELEMENT_OBJECT_TYPE    = 'object-type';
    const ELEMENT_LINK_ALTERNATE = 'link-alternate';
    const ELEMENT_ID             = 'id';
    const ELEMENT_TITLE          = 'title';
    
    const ELEMENT_LINK_AVATAR      = 'avatar';
    const ELEMENT_LINK_AVATAR_48   = 'avatar-48';
    const ELEMENT_POCO_DISPLAYNAME = 'poco:displayName';
    
    protected $tagname = "activity:subject";
    
    public function __construct(array $childElements) {
        parent::__construct($childElements);
    }
    
    /**
     * @return Mm_Atom_Element_ActivityStream_ObjectType
     */
    public function getObjectType() {
        return $this->getChildElement(self::ELEMENT_OBJECT_TYPE);
    }
    
    /**
     * @return Mm_Atom_Element_Link
     */
    public function getAlternateLink() {
        return $this->getChildElement(self::ELEMENT_LINK_ALTERNATE);
    }
    
    /**
     * @return Mm_Atom_Element_Id
     */
    public function getId() {
        return $this->getChildElement(self::ELEMENT_ID);
    }
    
    /**
     * @return Mm_Atom_Element_Title
     */
    public function getTitle() {
        return $this->getChildElement(self::ELEMENT_TITLE);
    }
}